package com.zhiyou100.advice;

import org.springframework.aop.AfterReturningAdvice;

import java.lang.reflect.Method;
import java.util.Arrays;

/**
 * @author yang
 * @className MyAfterAdvice
 * @packageName com.zhiyou100.advice
 * @Description TODO
 * @date 2020-08-19 14:38
 */
public class MyAfterAdvice implements AfterReturningAdvice {
    /**
     * 目标方法执行后要执行的方法
     *
     * @param returnValue 目标对象
     * @param method
     * @param args
     * @param target
     * @throws Throwable
     */
    @Override
    public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable {

        System.out.println("目标方法" + method.getName() + Arrays.toString(args) + " 执行后要执行的代码 ！！！！！！！！");

        System.out.println(returnValue + " " + target);
    }
}
